package com.wg.sparkdemo.hive;

import org.apache.spark.sql.SparkSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestHive1 {
	
	private static Logger logger = LoggerFactory.getLogger(TestHive1.class);

    public static void main(String[] args) throws ClassNotFoundException {
    	
    	SparkSession spark = SparkSession.builder()
    			.config("hive.metastore.uris", "thrift://nsn-host135.nsn.com:9083")
    			.enableHiveSupport().appName("TestHive1")
    			.master("local[4]").getOrCreate();
    	
    	spark.sql("show tables").show(10);
    	spark.sql("SET -v").show(200, false);
    	
    	logger.info(spark.conf().get("hive.metastore.uris"));
    	logger.info(spark.conf().get("ambari.hive.db.schema.name"));
    }
}
